org.eclipse.vtp.framework.interactions.voice.vxml
Class ExternalGrammar

java.lang.Object
  extended by org.eclipse.vtp.framework.interactions.core.support.Widget
      extended by org.eclipse.vtp.framework.interactions.voice.vxml.Grammar
          extended by org.eclipse.vtp.framework.interactions.voice.vxml.ExternalGrammar
All Implemented Interfaces:
VXMLConstants

public class ExternalGrammar
extends Grammar

The ExternalGrammar class represents the <grammar> VXML element with a reference to an external grammar file.

Version:
2.0
Author:
Trip Gilman, Lonnie Pryor

Field Summary
 
Fields inherited from interface org.eclipse.vtp.framework.interactions.voice.vxml.VXMLConstants
EMPTY, FILE_EXT_GSL, FILLED_MODE_ALL, FILLED_MODE_ANY, GRAMMAR_MODE_DTMF, GRAMMAR_MODE_VOICE, METHOD_GET, METHOD_POST, MIME_TYPE_GSL, MIME_TYPE_SRGS, NAME_APPLICATION, NAME_ASSIGN, NAME_AUDIO, NAME_BARGEIN, NAME_BEEP, NAME_BLOCK, NAME_BRIDGE, NAME_CATCH, NAME_CHOICE, NAME_COMPLETETIMEOUT, NAME_COND, NAME_CONFIDENCELEVEL, NAME_COUNT, NAME_DEST, NAME_DISCONNECT, NAME_DTMF, NAME_DTMFTERM, NAME_ELSE, NAME_ELSEIF, NAME_ENCTYPE, NAME_ENUMERATE, NAME_ERROR, NAME_EVENT, NAME_EVENTEXPR, NAME_EXIT, NAME_EXPR, NAME_FIELD, NAME_FILLED, NAME_FINALSILENCE, NAME_FORM, NAME_GOTO, NAME_GRAMMAR, NAME_ID, NAME_IF, NAME_INCOMPLETETIMEOUT, NAME_INPUTMODES, NAME_INTERDIGITTIMEOUT, NAME_ITEM, NAME_MAXNBEST, NAME_MAXSPEECHTIMEOUT, NAME_MAXTIME, NAME_MENU, NAME_METHOD, NAME_MODE, NAME_NAME, NAME_NAMELIST, NAME_NEXT, NAME_NOINPUT, NAME_NOMATCH, NAME_ONE_OF, NAME_OPTION, NAME_PARAM, NAME_PROMPT, NAME_PROPERTY, NAME_RECORD, NAME_REPEAT, NAME_REPROMPT, NAME_RETURN, NAME_ROOT, NAME_RULE, NAME_SCOPE, NAME_SCRIPT, NAME_SENSITIVITY, NAME_SPEEDVSACCURACY, NAME_SRC, NAME_SUBDIALOG, NAME_SUBMIT, NAME_TERMCHAR, NAME_TERMTIMEOUT, NAME_THROW, NAME_TIMEOUT, NAME_TRANSFER, NAME_TYPE, NAME_VALUE, NAME_VAR, NAME_VERSION, NAME_VXML, NAMESPACE_URI_VXML, QNAME_XML_LANG, SCOPE_DIALOG, SCOPE_DOCUMENT, TYPE_CDATA, VERSION_2_0
 
Constructor Summary
ExternalGrammar(java.lang.String mode, java.lang.String grammarURI)
          Creates a new ExternalGrammar.
ExternalGrammar(java.lang.String mode, java.lang.String grammarURI, java.lang.String grammarType)
          Creates a new ExternalGrammar.
 
Method Summary
protected  java.lang.String detectGrammarType()
          Attempts to detect the MIME type for this grammar.
 java.lang.String getGrammarType()
          Returns the MIME type of the external grammar file.
 java.lang.String getGrammarURI()
          Returns the URI of the external grammar file.
 void setGrammarType(java.lang.String grammarType)
          Sets the MIME type of the external grammar file.
 void setGrammarURI(java.lang.String grammarURI)
          Sets the URI of the external grammar file.
protected  void writeAttributes(org.xml.sax.helpers.AttributesImpl attributes)
          Write the attribute members of this grammar to the supplied set.
 
Methods inherited from class org.eclipse.vtp.framework.interactions.voice.vxml.Grammar
getMode, setMode, writeChildren, writeWidget
 
Methods inherited from class org.eclipse.vtp.framework.interactions.core.support.Widget
toString, writeAttribute, writeChildren, writeChildren, writeWidget, writeWidget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExternalGrammar

public ExternalGrammar(java.lang.String mode,
                       java.lang.String grammarURI)
                throws java.lang.IllegalArgumentException,
                       java.lang.NullPointerException
Creates a new ExternalGrammar.

Parameters:
mode - The mode of the grammar (dtmf or voice).
grammarURI - The URI of the external grammar file.
Throws:
java.lang.IllegalArgumentException - If the specified mode is not one of "dtmf" or "voice".
java.lang.IllegalArgumentException - If the specified grammar URI is empty.
java.lang.NullPointerException - If the specified mode is null.
java.lang.NullPointerException - If the specified grammar URI is null.

ExternalGrammar

public ExternalGrammar(java.lang.String mode,
                       java.lang.String grammarURI,
                       java.lang.String grammarType)
                throws java.lang.IllegalArgumentException,
                       java.lang.NullPointerException
Creates a new ExternalGrammar.

Parameters:
mode - The mode of the grammar (dtmf or voice).
grammarURI - The URI of the external grammar file.
grammarType - The MIME type of the external grammar file.
Throws:
java.lang.IllegalArgumentException - If the specified mode is not one of "dtmf" or "voice".
java.lang.IllegalArgumentException - If the specified grammar URI is empty.
java.lang.IllegalArgumentException - If the specified grammar type is empty.
java.lang.NullPointerException - If the specified mode is null.
java.lang.NullPointerException - If the specified grammar URI is null.
Method Detail

getGrammarURI

public java.lang.String getGrammarURI()
Returns the URI of the external grammar file.

Returns:
The URI of the external grammar file.

getGrammarType

public java.lang.String getGrammarType()
Returns the MIME type of the external grammar file.

Returns:
The MIME type of the external grammar file.

setGrammarURI

public void setGrammarURI(java.lang.String grammarURI)
                   throws java.lang.IllegalArgumentException,
                          java.lang.NullPointerException
Sets the URI of the external grammar file.

Parameters:
grammarURI - The URI of the external grammar file.
Throws:
java.lang.IllegalArgumentException - If the specified grammar URI is empty.
java.lang.NullPointerException - If the specified grammar URI is null.

setGrammarType

public void setGrammarType(java.lang.String grammarType)
                    throws java.lang.IllegalArgumentException
Sets the MIME type of the external grammar file.

Parameters:
grammarType - The MIME type of the external grammar file.
Throws:
java.lang.IllegalArgumentException - If the specified grammar type is empty.

writeAttributes

protected void writeAttributes(org.xml.sax.helpers.AttributesImpl attributes)
Description copied from class: Grammar
Write the attribute members of this grammar to the supplied set.

Overrides:
writeAttributes in class Grammar
Parameters:
attributes - The attribute set to write to.

detectGrammarType

protected java.lang.String detectGrammarType()
Attempts to detect the MIME type for this grammar.

Returns:
The detected MIME type for this grammar.